Skip to main content

Custom Systems Overview

Introduction

Welcome to the Custom Applications documentation. Here, we provide guidelines for integrating "Custom API Language Models" and "Custom RAG Applications" using DynamoEval's flexible adapter system.

General Features

The Custom Applications by Dynamo AI facilitate integration with your model endpoints through REST APIs. Key features include:

  • Acting as a bridge between DynamoEval and custom systems' endpoint
  • Requiring only a REST API
  • Supporting various authentication methods (e.g., No Auth, Bearer Token, API Key)
  • Enabling request/response transformations using JSONata expressions

Authentication Mechanisms

DynamoEval currently supports few common authentication types like:

  • No Authentication (no_auth)

    • No additional headers required
  • Bearer Token (bearer)

    • Uses an authorization header with a bearer token
  • API Key (api_key)

    • Customizable authorization header with an API key

JSONata Transformations

JSONata is a lightweight query and transformation language for JSON data. DynamoEval uses JSONata to transform requests and responses. See the JSONata documentation and JSONata playground for more details.

  1. Request Transformation: Converts DynamoEval's standard request format to your API's format
  2. Response Transformation: Converts your API's response format to DynamoEval's expected format

The transformations are applied in this order:

  1. DynamoEval request → Request Transform → Your API
  2. Your API response → Response Transform → DynamoEval

Basic Example

# Input format:
# { "message": "Hello", "metadata": { "timestamp": 123 } }

# Desired output format:
# { "text": "Hello", "time": 123 }

transformation_expression = """
{
"text": message, // Direct field mapping
"time": metadata.timestamp // Nested field access
}
"""

Advanced Features

For detailed examples of JSONata transformations:

Helper Prompt for JSONata Transformations

To simplify the process of writing JSONata code for transforming JSON objects, you can use the following LLM prompt and your favorite AI assistant. This prompt helps generate JSONata expressions by providing a sample of how your custom RAG adapter understands the data. Replace X with your specific JSON format:

Create a JSONata expression to transform the following JSON object:
Input: { "query": "user query text", "top_k": 3 }
Output: X

Example prompt

Create a JSONata expression to transform the following JSON object:
Input: { "query": "user query text", "top_k": 3 }
Output: { "searchQuery": query, "limit": top_k }